package maggames.core.exceptions;

import org.apache.log4j.Logger;

/**
 * Runtime Exception thrown when a class was not properly initialized before being used.
 * 
 * @author BenjaminPLee
 * @version 1.0
 */
public class UnIntializedException extends RuntimeException {
	private static final long serialVersionUID = 5529477660038764544L;
	private static final Logger log = Logger.getLogger(UnIntializedException.class);
	
	/**
	 * Default constructor.  Generic message is used.
	 */
	public UnIntializedException() {
		super("A class was not properly initialized prior to it being used.");
		log.debug("UnInitializedException thrown");
	}
	
	/**
	 * Constructor passed the class which was not initialized for reportin purposes.
	 * 
	 * @param clazz the class that was not initialized properly
	 */
	public UnIntializedException(Class clazz) {
		super("Class " + clazz.toString() + " was not initialized properly prior to it being used.");
		log.debug("UnInitializedException thrown from class " + clazz.toString());		
	}
}
